package com.jit.BluetoothKey.entity;

import android.databinding.BaseObservable;
import android.databinding.Bindable;
import android.databinding.Observable;

import com.jit.BluetoothKey.BR;

/**
 * Created by Administrator on 2018/3/7.
 * 单例模式保存车辆状态
 */

public class CarStatusBean extends BaseObservable{
    private static CarStatusBean instance;
    private String power = "--";  // 剩余电量
    private String mile = "--";   //里程数
    private String tirePressure = "正常" ; //轮胎压力
    private String temperature  = "--"; //车内温度

    public static CarStatusBean getInstance() {
        if (instance == null) {
            synchronized (BleControllerHelper.class) {
                if (instance == null) {
                    instance = new CarStatusBean();
                }
            }
        }
        return instance;
    }


    @Bindable
    public String getPower() {
        return power;
    }

    public void setPower(String power) {
        this.power = power;
        notifyPropertyChanged(BR.power);
    }

    @Bindable
    public String getMile() {
        return mile;
    }

    public void setMile(String mile) {
        this.mile = mile;
        notifyPropertyChanged(BR.mile);
    }

    @Bindable
    public String getTirePressure() {
        return tirePressure;
    }

    public void setTirePressure(String tirePressure) {
        this.tirePressure = tirePressure;
        notifyPropertyChanged(BR.tirePressure);
    }

    @Bindable
    public String getTemperature() {
        return temperature;
    }

    public void setTemperature(String temperature) {
        this.temperature = temperature;
        notifyPropertyChanged(BR.temperature);
    }
}
